Conventionally, there has been known a technology in which an opening/closing member such as a door, window glass, sun roof, or trunk lid provided to a vehicle such as an automobile is automatically opened and closed by an automatic opening/closing apparatus using an electric motor as a driving source. For example, in the automatic opening/closing apparatus that causes a sliding door provided to a side portion of the vehicle to be automatically opened and closed, a cable connected to the sliding door is wound around a drum, and this drum is driven by the electric motor for rotation, thereby causing the sliding door to perform an automatic opening and closing operation.
To the electric motor used in such an automatic opening/closing apparatus, a reduction gear is attached for decelerating rotation of the electric motor to the desired number of rotations. As such a reduction gear, a structure in which a worm gear mechanism is accommodated inside a gear case is often used. The worm gear mechanism includes a worm driven by the electric motor for rotation and a worm wheel engaged with the worm, wherein the rotation of the worm wheel is outputted from an output shaft disposed concentrically with the worm wheel. A tip portion of the output shaft protrudes from the gear case to the outside, and an output member such as the drum as described above is attached to the tip portion, whereby motive power of the output shaft is transmitted to the sliding door through the output member. Further, there has been also known a structure in which an electromagnetic clutch that interrupts motive-power transmission between the worm wheel and the output shaft is accommodated inside the gear case and, with this electromagnetic clutch, the automatic opening/closing apparatus is switched between an automatic opening/closing mode and a manual opening/closing mode.
On the other hand, in such an automatic opening/closing apparatus, the rotation of the output shaft is detected by a rotation sensor, and activation of the electric motor is controlled based on the rotation of the output shaft detected by the rotation sensor. As a rotation sensor, there has been known a structure which includes: a detected subject such as a magnet attached to the output shaft or a member rotating therewith; and a detection sensor such as a magnetic sensor disposed so as to be opposite to the detected subject. For example, Patent Document 1 (Japanese Patent Laid-Open Publication No. 2000-177391) discloses an automatic opening/closing apparatus in which the magnet serving as the detected subject is fixed to an outer circumferential portion of a clutch rotor rotating together with the output shaft and the magnetic sensor serving as the detection sensor is disposed on an outer-radial side of a moving path of the magnet. Also, Patent Document 2 (Japanese Patent Laid-Open Publication No. 2006-22513) discloses the automatic opening/closing apparatus in which the detected subject fixed to the output shaft is disposed outside the gear case and between the gear case and the drum and the detection sensor is disposed on an outer circumferential side of the detected subject.
In such a rotation sensor, the detection sensor outputs a pulse signal with a period proportional to the number of rotations of the detected subject, i.e., the output shaft, and this pulse signal is inputted to a controller. Then, from the period of the inputted pulse signal, the controller detects the number of rotations of the output shaft rotating along with the detected subject, i.e., a moving speed of the sliding door and concurrently totalizes pulse signals using, as a starting point, a time when the sliding door arrives at a reference position (e.g., a fully closed position), thereby detecting the opening/closing position of the sliding door and controlling the activation of the electric motor based on these detection results.